<template>
  <el-dialog :visible.sync="visible" width="1200px" top="52px" v-dialogDrag :title="title" :close-on-click-modal="false" class="tl-dialog page" @open="open" @close="close" :append-to-body="true" :modal-append-to-body="true">
    <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="110px" :disabled="disableEditSubmit">
      <div class="meetTitle">
        <div class="square"></div>
        <label class="meetInfo">会议基本信息</label>
      </div>
      <el-row>
        <el-col :span="24">
          <el-form-item label="会议主题" maxlength="100" prop="name" :rules="rules.validateRequire">
            <el-input v-model="model.name" placeholder="请输入会议主题"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="会议内容" prop="content">
            <el-input v-model="model.content" type="textarea" :rows="2" placeholder="请输入会议内容"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="7">
          <el-form-item label="开始时间" prop="begintimeDate" :rules="rules.validateRequire">
            <el-date-picker v-model="model.begintimeDate" type="date" placeholder="开始时间" value-format="yyyy-MM-dd" :picker-options="expireTimeOption"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="" label-width="10px" prop="begintimeTime" :rules="rules.validateRequire">
            <el-time-select
               @change="changeBegintimeTime"
              v-model="model.begintimeTime"
              placeholder="选择时间"
              editable
              :clearable="false"
              :picker-options="{
                start: '00:00',
                step: '00:05',
                end: '24:00'
              }"
            >
            </el-time-select>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="结束时间" prop="endtimeDate" :rules="rules.validateRequire">
            <el-date-picker v-model="model.endtimeDate" type="date" placeholder="结束时间" value-format="yyyy-MM-dd" :picker-options="expireTimeOption"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="" label-width="10px" prop="endtimeTime" v-bind:rulesconfig="rules.validateRequire">
            <el-time-select
              @change="changeEndtimeTime"
              v-model="model.endtimeTime"
              placeholder="选择时间"
              editable
              :picker-options="{
                start: '00:00',
                step: '00:05',
                end: '24:00'
              }"
            >
            </el-time-select>
          </el-form-item>
        </el-col>
      </el-row>
      <!--周期配置-->
      <tl-period-row-config v-model="model"></tl-period-row-config>
      <el-row>
        <el-col :span="12">
          <el-form-item label="会议类型" prop="meettypeid" :rules="rules.validateRequire">
            <el-cascader v-model="model.selectmeettypelist" :options="meetTypeList" style="width:450px" filterable @change="handleMeetTypeChange" clearable></el-cascader>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="会议形式" prop="meetstyle" :rules="rules.validateRequire">
            <el-select v-model="model.meetstyle" filterable clearable>
              <el-option v-for="item in codeModel.meetstyleList" :key="item.code" :label="item.name" :value="item.code" />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="会议室" prop="meetroomid">
            <el-input v-model="model.airlinecompany" :disabled="true" class="tl-ref-selector">
              <el-button slot="append" type="primary" icon="el-icon-search" @click="openMeetRoomRefDialog" v-if="!disableEditSubmit"></el-button>
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="自定义地点" prop="place">
            <el-input v-model="model.place" placeholder="如果需要自定义会议地点，请在此输入"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="会议标签" prop="keywords">
            <el-input v-model="model.keywords" placeholder="会议关键字信息"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <div class="meetTitle">
        <div class="square"></div>
        <label class="meetInfo">参会人员</label>
      </div>
      <el-row>
        <el-col :span="24">
          <el-form-item label="参会人员">
            <tl-ref-mulit-user-select v-model="users" :disabled="disableEditSubmit"></tl-ref-mulit-user-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="发起人" prop="launchusername" :rules="rules.validateRequire">
            <tl-ref-user v-model="model.launchusercode" :initDisplayData.sync="model.launchusername" dataType="code" :singleSelect="true" :disabled="disableEditSubmit" :externalQueryParam="{qry_whereSql:'EXTENDFIELD1 IS NOT NULL AND ENABLED = 1',qry_nodimission:'0'}" ></tl-ref-user>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="发起组织类型" prop="launchorgtype" :rules="rules.validateRequire">
            <el-select v-model="model.launchorgtype" filterable clearable @change="clearOrgInfo">
              <el-option v-for="item in codeModel.launchorgtypeList" :key="item.code" :label="item.name" :value="item.code" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12" v-show="model.launchorgtype">
          <el-form-item label="发起组织" prop="launchorgname" :rules="rules.validateRequire">
            <tl-ref-dept v-show="model.launchorgtype === 'dept'" v-model="model.launchorgindex" :initDisplayData.sync="model.launchorgname" nameType="fullname" dataType="code" :singleSelect="true" :disabled="disableEditSubmit"></tl-ref-dept>
            <tl-ref-list v-show="model.launchorgtype === 'team'" v-model="model.launchorgindex" :initDisplayData.sync="model.launchorgname" refTitle="管理团队选择" dataType="id" :queryDataUrl="url.queryTeamList" :singleSelect="true" :disabled="disableEditSubmit"></tl-ref-list>
          </el-form-item>
        </el-col>
      </el-row>
      <div class="meetTitle">
        <div class="square"></div>
        <label class="meetInfo">通知配置</label>
      </div>
      <el-row>
        <el-col :span="7">
          <el-form-item label="提前确认" prop="advancedays" :rules="rules.validateRequire.concat(rules.validateIntGteZero)">
            <el-input v-model="model.advancedays" placeholder="天数">
              <template slot="append">
                天
              </template>
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="1">
          <el-form-item label-width="5px">
            <tl-help>
              周期会议生成的会议，会默认将下次会议状态设置为发布，此处设定提前确认的天数，系统会按此时间对创建人进行提醒，若需要取消会议请提前进行取消操作，否则不需要执行任何操作。
            </tl-help>
          </el-form-item>
        </el-col>
      </el-row>
      <tl-remind-config v-model="remindList"></tl-remind-config>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doSubmitEdit" :loading="saveLoading" v-if="model.state !== 1 && !disableEditSubmit"><svg-icon icon-class="save" />暂存</el-button>
      <el-button type="primary" @click="doSubmitIssue" :loading="saveLoading" v-if="!disableEditSubmit"><svg-icon icon-class="send" />发布</el-button>
      <el-button type="primary" @click="openPeroidList" :loading="saveLoading" v-if="model.state === 1 || model.state === 2" icon="el-icon-date">查看周期安排</el-button>
      <el-button type="primary" @click="doCancelMeet" :loading="saveLoading" v-if="!isAdd && model.state === 1 && !disableEditSubmit"><svg-icon icon-class="undo" />终止</el-button>
      <el-button type="primary" @click="doTransferUser" :loading="saveLoading" v-if="model.state === 1 || model.state === 2" icon="el-icon-user">移交</el-button>
    </div>
    <tl-meet-record-edit ref="meetRecordEditForm" sourceType="meetCreate"></tl-meet-record-edit>
    <tl-meet-room-item-ref ref="meetRoomRef" @confirm="doSubmitMeetRoom" :externalQueryParam="qryRoomParams" :isSingleSelect="true"></tl-meet-room-item-ref>
    <tl-ref-user ref="userAssignRef" @confirm="doSelectUser" :isDisplayDefaultElement="false" :singleSelect="true" dataType="code"> </tl-ref-user>
    <tl-period-list ref="periodList"></tl-period-list>
  </el-dialog>
</template>
<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'
import { formatDate } from '@tapui/utils/date'
import { queryDataCode } from '@tapui/api/dataCode'
/** 子组件 */
import tlMeetAgenda from '../meetAgenda/index'
import tlMeetRecordEdit from '../meetRecord/edit'
import tlRefMeetType from '../meetTypeManage/refMeetType'
import tlRefMulitUserSelect from '@/components/common/refMulitUserSelect'
import tlPeriodRowConfig from '@/components/common/periodRow'
import tlRemindConfig from '@/components/common/remindConfig'
import tlMeetRoomItemRef from '../meetRoomManage/refList'
import tlPeriodList from '../meetManage/periodList'
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  name: "PeriodEdit",
  mixins: [mixin_edit],
  components: { tlMeetAgenda, tlMeetRoomItemRef, tlRefMeetType, tlMeetRecordEdit, tlRefMulitUserSelect, tlPeriodRowConfig, tlRemindConfig, tlPeriodList },
  data() {
    return {
      moduleTitle: '周期会议',
      urlPrefix: '/meet/peroidTask/',
      activeTab: 'basic',
      url: {
        add: '/meet/peroidTask/save',
        edit: '/meet/peroidTask/save',
        queryTeamList: 'base/teamInfo/list', // 查询团队
        queryVisibleTeamList: 'base/teamInfo/list?qry_visible=1', // 查询可见团队
        publish: 'meet/peroidTask/publish', // 发布会议
        cancel: 'meet/peroidTask/cancel', // 取消会议
        transfer: 'meet/peroidTask/transfer', // 移交会议
        queryUser: '/base/permissionManage/queryList', // 查询人员
        queryRemind: '/base/remindConfig/list', // 查询通知配置
        queryMeetTypeList: '/meet/typeManage/queryTreeList'
      },
      teamRefTitle: '团队选择',
      isQueryInitData: true,
      selectedMembers: {},
      isMemberSearch: false,
      activeNames: ['baseinfo', 'place', 'launchorg', 'notice'],
      users: {
        usernames: '',
        usercodes: '',
        deptnames: '',
        deptcodes: '',
        teamids: '',
        teamnames: '',
        roleids: '',
        rolenames: ''
      },
      remindTypeList: [],
      remindUnitTypeList: [],
      remindList: [], // 提醒
      selectmeettypelist: [],
      meetTypeList: [],
      oldModel: {},
      oldRemindList: [],
      oldUsers: {},
      expireTimeOption: {
        disabledDate(date) {
          // 当天可选
          return date.getTime() < Date.now() - 24 * 60 * 60 * 1000
        }
      },
      // 查询可用会议室会议室
      qryRoomParams: {
        qry_available: '1'
      },
      // 控制结束时间是否根据开始时间变更
      endtimeChangeNoMore: false
    }
  },
  props: {
    sourceType: {
      type: String,
      default: 'meetCreate'
    }
  },
  computed: {
    // 计算参会人员数目
    attendUserCount() {
      let count = 0
      for (let index in this.model.basesharelist) {
        let item = this.model.basesharelist[index]
        if (item.sharetype === 'attend' && item.allusernames) {
          count = item.allusernames.split(',').length
          break
        }
      }
      return count
    }
  },
  methods: {
    close() {
      this.endtimeChangeNoMore = false
      this.$emit("refresh")
    },
    loaded() {
      // 新建会议时，页面加载完毕执行
      if (this.model.state === 2) {
        this.disableEditSubmit = true
      }
      // 设置初始页签为会议基本信息
      this.activeTab = 'basic'
      this.isMemberSearch = false
      this.remindId = -1
      // 页面加载完毕执行
      if (this.isAdd) {
        this.$set(this.model, 'periodtype', 'day')
      }
      if (!this.isAdd) {
        // 时间拆分
        if (this.model.begintime) {
          let beginArr = this.model.begintime.split(' ')
          this.$set(this.model, 'begintimeDate', beginArr[0])
          this.$set(this.model, 'begintimeTime', beginArr[1].substring(0, 5))
        } else {
          this.$set(this.model, 'begintimeDate', '')
          this.$set(this.model, 'begintimeTime', '')
        }
        if (this.model.endtime) {
          let endArr = this.model.endtime.split(' ')
          this.$set(this.model, 'endtimeDate', endArr[0])
          this.$set(this.model, 'endtimeTime', endArr[1].substring(0, 5))
        } else {
          this.$set(this.model, 'endtimeDate', '')
          this.$set(this.model, 'endtimeTime', '')
        }

        // 保存旧数据
        this.oldModel = JSON.parse(JSON.stringify(this.model))
        this.queryRemind()
        this.queryUser()
      } else {
        // 新增
        this.setDefaultValue()
      }
    },
    // 新增时设置初始默认值
    setDefaultValue() {
      this.$set(this.model, 'stoptype', 1)
      this.$set(this.model, 'enabled', 1)
      this.$set(this.model, 'sortcode', 0)
      this.$set(this.model, 'usercode', this.user.code)
      this.$set(this.model, 'username', this.user.name)
      this.$set(this.model, 'telephone', this.user.mobile)
      this.$set(this.model, 'launchusercode', this.user.code)
      this.$set(this.model, 'launchusername', this.user.name)
      this.$set(this.model, 'launchorgtype', 'dept')
      this.$set(this.model, 'launchorgindex', this.dept.code)
      this.$set(this.model, 'launchorgname', this.dept.fullname)
      this.$set(this.model, 'begintimeTime', '09:00')
      this.$set(this.model, 'endtimeTime', '11:00')
      this.$set(this.model, 'begintimeDate', formatDate(new Date(), 'yyyy-MM-dd'))
      this.$set(this.model, 'endtimeDate', formatDate(new Date(), 'yyyy-MM-dd'))
      // 会议形式设置默认值：线下(code为1)
      this.$set(this.model, 'meetstyle', '1')
      this.users = {
        usernames: this.user.name,
        usercodes: this.user.code,
        deptnames: '',
        deptcodes: '',
        teamids: '',
        teamnames: '',
        roleids: '',
        rolenames: ''
      }
      // 默认
      this.remindList = [
        {
          id: 0,
          remindtype: '1',
          noticetype: 'app',
          unit: '1',
          value: 1,
          timeValue: '09:00:00'
        }
      ]
    },
    /** 重写编辑，发请求获得数据 */
    queryData(id) {
      if (!this.url.load) {
        this.$tap.alert('请设置load地址!', 'warning')
        return
      }
      return getAction(this.url.load, { id: id, operatetype: this.sourceType }).then(res => {
        if (res.success) {
          this.model = res.result
        } else {
          this.$tap.alert(res.message, 'warning')
        }
      })
    },
    /** 重写doQueryCode方法，查询编码表*/
    doQueryCode() {
      if (this.url.queryCodeList) {
        let data = {}
        if (this.sourceType === 'meetCreate') {
          this.$set(data, 'qry_isall', 0)
        }
        getAction(this.url.queryCodeList, data).then(res => {
          if (res.success) {
            this.codeModel = res.result
          } else {
            this.$tap.alert(res.message, 'warning')
          }
        })
      }
    },
    // 当切换组织类型时，清空组织信息
    clearOrgInfo() {
      this.$set(this.model, 'launchorgindex', '')
      this.$set(this.model, 'launchorgname', '')
    },
    /** 提交前检查 */
    beforeSubmit() {
      this.model.begintime = `${this.model.begintimeDate} ${this.model.begintimeTime}`
      this.model.endtime = `${this.model.endtimeDate} ${this.model.endtimeTime}`
      let beginTime = new Date(this.model.begintime)
      let endTime = new Date(this.model.endtime)
      if (endTime <= beginTime) {
        this.$tap.alert('会议结束时间不能早于会议开始时间！')
        return false
      }
      // 人员组装
      if (this.users.usercodes.length === 0 && this.users.deptcodes.length === 0 && this.users.teamids.length === 0 && this.users.roleids.length === 0) {
        this.$tap.message('请选择参会人', 'error')
        return false
      }
      if (this.model.periodtype === 'day') {
        if (this.model.advancedays > 2) {
          this.$tap.message('日会议类型，提前最多2天确认', 'error')
          return false
        }
      } else if (this.model.periodtype === 'week') {
        if (this.model.advancedays > 7) {
          this.$tap.message('周会议类型，提前最多7天确认', 'error')
          return false
        }
      } else if (this.model.periodtype === 'month') {
        if (this.model.advancedays > 7) {
          this.$tap.message('月会议类型，提前最多30天确认', 'error')
          return false
        }
      }
      this.model.selectUsers = this.users
      // 提醒配置组装
      let remindList = []
      this.remindList.forEach((remind, index) => {
        remindList.push({
          id: remind.id,
          remindtype: remind.remindtype,
          unit: remind.unit,
          value: remind.remindtype === '1' ? remind.value : remind.timeValue,
          noticetype: remind.noticetype,
          sortcode: index
        })
      })
      this.model.remindList = remindList
      // 周期配置
      if (this.model.stoptype === 1) {
        this.$set(this.model, 'repeatcount', 0)
      } else {
        this.$set(this.model, 'stoptime', null)
      }
      // 周期任务中按月选择后。判断选择的是每月第多少天还是每月第几个周的周几
      if (this.model.periodtype === 'month') {
        if (this.model.monthrepeattype === 1) {
          // 每月第几周的周几
          this.$set(this.model, 'daysequence', this.model.monthRepeatWeek)
          this.$set(this.model, 'weeksequence', this.model.monthRepeatWeekSeq)
        } else {
          // 每月第多少天
          this.$set(this.model, 'daysequence', this.model.monthRepeatDay)
          this.$set(this.model, 'weeksequence', null)
        }
      }
      return true
    },
    // 执行发布会议
    doSubmitIssue() {
      let that = this
      let message = ''
      if (this.model.state === 1) {
        message = '该周期会议已经发布，再次发布，会将当前时间之后的未发布的会议重新生成，请谨慎处理！'
      } else {
        message = '是否发布会议？发布后会周期会议将执行！'
      }
      this.$refs.form.validate(valid => {
        if (valid) {
          this.$tap
            .confirm(message)
            .then(_ => {
              // 避免发布，后台大量操作处理，时间慢
              if (this.model.state === 1 && JSON.stringify(this.oldModel) === JSON.stringify(this.model) && JSON.stringify(this.oldRemindList) === JSON.stringify(this.remindList) && JSON.stringify(this.oldUsers) === JSON.stringify(this.users)) {
                this.$tap.message('发布成功', 'success')
                this.visible = false
                return
              }
              if (!this.beforeSubmit()) {
                return
              }
              that.saveLoading = true
              postAction(this.url.publish, this.model).then(res => {
                if (res.success) {
                  this.oldModel = JSON.parse(JSON.stringify(this.model))
                  this.$tap.message(res.message, 'success')
                  this.$emit('refresh')
                  this.visible = false
                  that.saveLoading = false
                } else {
                  this.$tap.alert(res.message, 'warning')
                  that.saveLoading = false
                }
              })
            })
            .catch(_ => {
              that.saveLoading = false
            })
        } else {
          return false
        }
      })
    },
    // 取消会议室审批，将会议状态置为作废
    doCancelMeet() {
      let that = this
      this.$tap
        .confirm('是否终止周期会议？')
        .then(_ => {
          that.saveLoading = true
          postAction(this.url.cancel, this.model).then(res => {
            if (res.success) {
              this.disableEditSubmit = true
              this.$tap.message(res.message, 'success')
              this.$emit('refresh')
              that.saveLoading = false
            } else {
              this.$tap.alert('作废失败', 'warning')
              that.saveLoading = false
              this.visible = false
            }
          })
        })
        .catch(_ => {
          that.saveLoading = false
        })
    },
    // 查询提醒配置
    queryRemind() {
      getAction(this.url.queryRemind, { qry_sourcetype: 'MeetPeroidTask', qry_sourceid: this.model.id }).then(res => {
        if (res.success) {
          this.remindList = []
          res.result.dataList.forEach(m => {
            this.remindList.push({
              id: m.id,
              remindtype: m.remindtype,
              noticetype: m.noticetype,
              unit: m.unit,
              value: m.remindtype === '1' ? m.value : '1',
              timeValue: m.remindtype === '2' ? m.value : '09:00:00'
            })
          })
          // 保存旧
          this.oldRemindList = JSON.parse(JSON.stringify(this.remindList))
        }
      })
    },
    // 查询人员
    queryUser() {
      getAction(this.url.queryUser, { qry_sourcetype: 'MeetPeroidTask', qry_sourceid: this.model.id }).then(res => {
        if (res.success) {
          this.users = {
            usernames: '',
            usercodes: '',
            deptnames: '',
            deptcodes: '',
            teamids: '',
            teamnames: '',
            roleids: '',
            rolenames: ''
          }
          res.result.forEach(m => {
            if (m.sharetype === '5') {
              this.users.usernames = m.shareobjectsdesc
              this.users.usercodes = m.shareobjects
            } else if (m.sharetype === '1') {
              this.users.deptnames = m.shareobjectsdesc
              this.users.deptcodes = m.shareobjects
            } else if (m.sharetype === '3') {
              this.users.rolenames = m.shareobjectsdesc
              this.users.roleids = m.shareobjects
            } else if (m.sharetype === '2') {
              this.users.teamnames = m.shareobjectsdesc
              this.users.teamids = m.shareobjects
            }
          })
          // 保存旧
          this.oldUsers = JSON.parse(JSON.stringify(this.users))
        }
      })
    },
    /** 打开会议室参照 */
    openMeetRoomRefDialog() {
      this.$refs.meetRoomRef.visible = true
    },
    /** 选择会议室 */
    doSubmitMeetRoom(selectData) {
      if (selectData.length === 0) {
        this.$set(this.model, 'meetroomid', '')
        this.$set(this.model, 'airlinecompany', '')
        this.$set(this.model, 'place', '')
      } else {
        this.$set(this.model, 'meetroomid', selectData.id)
        this.$set(this.model, 'airlinecompany', selectData.name + '(' + selectData.locationdesc + ')')
        this.$set(this.model, 'place', selectData.name + '(' + selectData.locationdesc + ')')
      }
    },
    /** 打开周期明细界面 */
    openPeroidList() {
      this.$refs.periodList.filtersInfo = {
        qry_peroidtaskid: this.model.id
      }
      this.$refs.periodList.visible = true
    },
    handleMeetTypeChange(value) {
      if (typeof value !== 'undefined') {
        this.model.meettypeid = value[value.length - 1]
      }
    },
    /** 移交给其他人 */
    doTransferUser() {
      this.$refs.userAssignRef.openRefDialog()
    },
    /** 得到选择的用户*/
    doSelectUser(selectUser) {
      if (selectUser.length === 0) {
        return
      }
      //  判断是否选择自己
      if (this.model.usercode === selectUser[0].code) {
        this.$tap.alert('不能选择自己', 'warning')
        return
      }
      let that = this
      this.$tap
        .confirm('是否将该周期会议移交给<' + selectUser[0].name + '>进行管理？移交后你不再拥有该周期会议管理权限!')
        .then(_ => {
          that.saveLoading = true
          postAction(this.url.transfer, { id: this.model.id, usercode: selectUser[0].code, username: selectUser[0].name }).then(res => {
            if (res.success) {
              this.$tap.message(res.message, 'success')
              this.$emit('refresh')
              that.saveLoading = false
              this.visible = false
            } else {
              this.$tap.alert('移交失败', 'warning')
              that.saveLoading = false
              this.visible = false
            }
          })
        })
        .catch(_ => {
          that.saveLoading = false
        })
    },
    /**
     * 根据开始时间对结束时间进行修改
     */
    changeBegintimeTime() {
      if (!this.endtimeChangeNoMore) {
        let begindate = new Date(`${this.model.begintimeDate} ${this.model.begintimeTime}`)
        // 加9 是因为ISO默认时区为UTC+0  需要utc+8 +1
        let enddate = new Date(begindate.setHours(begindate.getHours() + 9))
        this.model.endtimeDate = enddate.toISOString().substring(0, 10)
        this.model.endtimeTime = enddate.toISOString().substring(11, 16)
      }
    },
     changeEndtimeTime() {
      this.endtimeChangeNoMore = true
    }
  },
  created() {
    queryDataCode({ itemCodes: 'BaseRemindType,BaseNoticeType,BaseRemindUnitType' }).then(res => {
      this.remindTypeList = res.result.BaseRemindType
      this.remindUnitTypeList = res.result.BaseRemindUnitType
    })
    /** 查询会议类型树 */
    getAction(this.url.queryMeetTypeList, { isAddRoot: false }).then(res => {
      if (res.success) {
        let reg = new RegExp('id', 'g') // g代表全部
        this.meetTypeList = JSON.parse(JSON.stringify(res.result.dataList).replace(reg, 'value'))
      }
    })
  }
}
</script>
<style scoped lang="scss">
.tag-container {
  .el-tag {
    margin-right: 5px;
  }
}
.color-block {
  display: inline-block;
  height: 15px;
  width: 15px;
}
.input-with-select {
  .el-select {
    width: 80px;
  }
}
</style>
<style lang="scss">
.page .share-content {
  margin-left: 15px;
  margin-bottom: 5px;
}
.page .label-content {
  color: #409eff;
}
.page .el-collapse-item__header {
  color: blue;
}

.page .el-divider__text {
  color: blue;
}
.page .el-row {
  margin-right: 40px;
}
.page .el-divider--horizontal {
  margin: 14px 0;
}
.page .meetTitle {
  padding-top: 5px;
  padding-bottom: 10px;
  padding-left: 30px;
}
.page .meetInfo {
  color: black;
  font-size: 14px;
  font-weight: bold !important;
  vertical-align: middle;
}
.page .el-scrollbar__wrap {
  overflow-x: hidden;
}
</style>
